from django.db import models

# Create your models here.
class UserInfo(models.Model):
    name = models.CharField(max_length=32)
    password = models.CharField(max_length=64)
    age = models.IntegerField()

"""
上面的语句等同于
create table myapp_userinfo(
    id bigint auto_increment primary key,
    name varchar(32),
    password varchar(64),
    age int
)
"""

"""
BigAutoField是一个64位的整数，和AutoField很像，只是它能保证适合从1到9223372036854775807的数字。人们可以使用以下语法创建一个BigAutoField。
id = models.BigAutoField(primary_key=True, **options)
Python
这是一个自动递增的主键，就像AutoField一样
"""
class Department(models.Model):
    id = models.BigAutoField(primary_key=True)
    title = models.CharField(max_length=64)